package zhuyun.code.uiutils

import android.content.Context
import android.content.res.Resources

/**
 * @author: Administrator
 * @date: 2022/1/15
 */
object UIUtils {
    fun dip2px(dpValue:Float):Int{
        val scale = Resources.getSystem().displayMetrics.density
        return (dpValue * scale + 0.5f).toInt()
    }

    fun px2dip(pxValue:Float):Int{
        val scale = Resources.getSystem().displayMetrics.density
        return (pxValue/scale + 0.5f).toInt()
    }
}